\(\int (d+i c d x) (a+b \arctan (c x)) \, dx\) [4]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 53 \[ \int (d+i c d x) (a+b \arctan (c x)) \, dx=-\frac {1}{2} i b d x-\frac {i d (1+i c x)^2 (a+b \arctan (c x))}{2 c}-\frac {b d \log (i+c x)}{c} \]

[Out]

-1/2*I*b*d*x-1/2*I*d*(1+I*c*x)^2*(a+b*arctan(c*x))/c-b*d*ln(I+c*x)/c

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {4972, 641, 45} \[ \int (d+i c d x) (a+b \arctan (c x)) \, dx=-\frac {i d (1+i c x)^2 (a+b \arctan (c x))}{2 c}-\frac {b d \log (c x+i)}{c}-\frac {1}{2} i b d x \]

[In]

Int[(d + I*c*d*x)*(a + b*ArcTan[c*x]),x]

[Out]

(-1/2*I)*b*d*x - ((I/2)*d*(1 + I*c*x)^2*(a + b*ArcTan[c*x]))/c - (b*d*Log[I + c*x])/c

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 641

Int[((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)^(m + p)*(a/d + (c/e)*x)^
p, x] /; FreeQ[{a, c, d, e, m, p}, x] && EqQ[c*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && I
ntegerQ[m + p]))

Rule 4972

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))*((d_) + (e_.)*(x_))^(q_.), x_Symbol] :> Simp[(d + e*x)^(q + 1)*((a + b*
ArcTan[c*x])/(e*(q + 1))), x] - Dist[b*(c/(e*(q + 1))), Int[(d + e*x)^(q + 1)/(1 + c^2*x^2), x], x] /; FreeQ[{
a, b, c, d, e, q}, x] && NeQ[q, -1]

Rubi steps \begin{align*} \text {integral}& = -\frac {i d (1+i c x)^2 (a+b \arctan (c x))}{2 c}+\frac {(i b) \int \frac {(d+i c d x)^2}{1+c^2 x^2} \, dx}{2 d} \\ & = -\frac {i d (1+i c x)^2 (a+b \arctan (c x))}{2 c}+\frac {(i b) \int \frac {d+i c d x}{\frac {1}{d}-\frac {i c x}{d}} \, dx}{2 d} \\ & = -\frac {i d (1+i c x)^2 (a+b \arctan (c x))}{2 c}+\frac {(i b) \int \left (-d^2+\frac {2 i d^2}{i+c x}\right ) \, dx}{2 d} \\ & = -\frac {1}{2} i b d x-\frac {i d (1+i c x)^2 (a+b \arctan (c x))}{2 c}-\frac {b d \log (i+c x)}{c} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.58 \[ \int (d+i c d x) (a+b \arctan (c x)) \, dx=a d x-\frac {1}{2} i b d x+\frac {1}{2} i a c d x^2+\frac {i b d \arctan (c x)}{2 c}+b d x \arctan (c x)+\frac {1}{2} i b c d x^2 \arctan (c x)-\frac {b d \log \left (1+c^2 x^2\right )}{2 c} \]

[In]

Integrate[(d + I*c*d*x)*(a + b*ArcTan[c*x]),x]

[Out]

a*d*x - (I/2)*b*d*x + (I/2)*a*c*d*x^2 + ((I/2)*b*d*ArcTan[c*x])/c + b*d*x*ArcTan[c*x] + (I/2)*b*c*d*x^2*ArcTan
[c*x] - (b*d*Log[1 + c^2*x^2])/(2*c)

Maple [A] (verified)

Time = 0.34 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.32

method result size
parts \(-i a d \left (-\frac {1}{2} c \,x^{2}+i x \right )+\frac {b d \left (\frac {i \arctan \left (c x \right ) c^{2} x^{2}}{2}+c x \arctan \left (c x \right )+\frac {i \left (-c x +i \ln \left (c^{2} x^{2}+1\right )+\arctan \left (c x \right )\right )}{2}\right )}{c}\) \(70\)
derivativedivides \(\frac {-i a d \left (-\frac {1}{2} c^{2} x^{2}+i c x \right )+b d \left (\frac {i \arctan \left (c x \right ) c^{2} x^{2}}{2}+c x \arctan \left (c x \right )+\frac {i \left (-c x +i \ln \left (c^{2} x^{2}+1\right )+\arctan \left (c x \right )\right )}{2}\right )}{c}\) \(74\)
default \(\frac {-i a d \left (-\frac {1}{2} c^{2} x^{2}+i c x \right )+b d \left (\frac {i \arctan \left (c x \right ) c^{2} x^{2}}{2}+c x \arctan \left (c x \right )+\frac {i \left (-c x +i \ln \left (c^{2} x^{2}+1\right )+\arctan \left (c x \right )\right )}{2}\right )}{c}\) \(74\)
parallelrisch \(\frac {i b d \arctan \left (c x \right ) x^{2} c^{2}+i a \,c^{2} d \,x^{2}-i b d x c +2 b c d x \arctan \left (c x \right )+i b d \arctan \left (c x \right )+2 a c d x -b d \ln \left (c^{2} x^{2}+1\right )}{2 c}\) \(79\)
risch \(\frac {b d \left (c \,x^{2}-2 i x \right ) \ln \left (i c x +1\right )}{4}+\frac {i a c d \,x^{2}}{2}-\frac {d c \,x^{2} b \ln \left (-i c x +1\right )}{4}+\frac {i b d x \ln \left (-i c x +1\right )}{2}-\frac {i b d x}{2}+\frac {i d b \arctan \left (c x \right )}{2 c}+a d x -\frac {b d \ln \left (c^{2} x^{2}+1\right )}{2 c}\) \(102\)

[In]

int((d+I*c*d*x)*(a+b*arctan(c*x)),x,method=_RETURNVERBOSE)

[Out]

-I*a*d*(-1/2*c*x^2+I*x)+b*d/c*(1/2*I*arctan(c*x)*c^2*x^2+c*x*arctan(c*x)+1/2*I*(-c*x+I*ln(c^2*x^2+1)+arctan(c*
x)))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 89 vs. \(2 (41) = 82\).

Time = 0.25 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.68 \[ \int (d+i c d x) (a+b \arctan (c x)) \, dx=\frac {2 i \, a c^{2} d x^{2} + 2 \, {\left (2 \, a - i \, b\right )} c d x - 3 \, b d \log \left (\frac {c x + i}{c}\right ) - b d \log \left (\frac {c x - i}{c}\right ) - {\left (b c^{2} d x^{2} - 2 i \, b c d x\right )} \log \left (-\frac {c x + i}{c x - i}\right )}{4 \, c} \]

[In]

integrate((d+I*c*d*x)*(a+b*arctan(c*x)),x, algorithm="fricas")

[Out]

1/4*(2*I*a*c^2*d*x^2 + 2*(2*a - I*b)*c*d*x - 3*b*d*log((c*x + I)/c) - b*d*log((c*x - I)/c) - (b*c^2*d*x^2 - 2*
I*b*c*d*x)*log(-(c*x + I)/(c*x - I)))/c

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 128 vs. \(2 (44) = 88\).

Time = 1.29 (sec) , antiderivative size = 128, normalized size of antiderivative = 2.42 \[ \int (d+i c d x) (a+b \arctan (c x)) \, dx=\frac {i a c d x^{2}}{2} + \frac {b d \left (- \frac {\log {\left (b c d x - i b d \right )}}{4} - \frac {5 \log {\left (b c d x + i b d \right )}}{12}\right )}{c} + x \left (a d - \frac {i b d}{2}\right ) + \left (\frac {b c d x^{2}}{4} - \frac {i b d x}{2}\right ) \log {\left (i c x + 1 \right )} + \frac {\left (- 3 b c^{2} d x^{2} + 6 i b c d x - 4 b d\right ) \log {\left (- i c x + 1 \right )}}{12 c} \]

[In]

integrate((d+I*c*d*x)*(a+b*atan(c*x)),x)

[Out]

I*a*c*d*x**2/2 + b*d*(-log(b*c*d*x - I*b*d)/4 - 5*log(b*c*d*x + I*b*d)/12)/c + x*(a*d - I*b*d/2) + (b*c*d*x**2
/4 - I*b*d*x/2)*log(I*c*x + 1) + (-3*b*c**2*d*x**2 + 6*I*b*c*d*x - 4*b*d)*log(-I*c*x + 1)/(12*c)

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.38 \[ \int (d+i c d x) (a+b \arctan (c x)) \, dx=\frac {1}{2} i \, a c d x^{2} + \frac {1}{2} i \, {\left (x^{2} \arctan \left (c x\right ) - c {\left (\frac {x}{c^{2}} - \frac {\arctan \left (c x\right )}{c^{3}}\right )}\right )} b c d + a d x + \frac {{\left (2 \, c x \arctan \left (c x\right ) - \log \left (c^{2} x^{2} + 1\right )\right )} b d}{2 \, c} \]

[In]

integrate((d+I*c*d*x)*(a+b*arctan(c*x)),x, algorithm="maxima")

[Out]

1/2*I*a*c*d*x^2 + 1/2*I*(x^2*arctan(c*x) - c*(x/c^2 - arctan(c*x)/c^3))*b*c*d + a*d*x + 1/2*(2*c*x*arctan(c*x)
 - log(c^2*x^2 + 1))*b*d/c

Giac [F]

\[ \int (d+i c d x) (a+b \arctan (c x)) \, dx=\int { {\left (i \, c d x + d\right )} {\left (b \arctan \left (c x\right ) + a\right )} \,d x } \]

[In]

integrate((d+I*c*d*x)*(a+b*arctan(c*x)),x, algorithm="giac")

[Out]

sage0*x

Mupad [B] (verification not implemented)

Time = 0.35 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.38 \[ \int (d+i c d x) (a+b \arctan (c x)) \, dx=\frac {d\,\left (2\,a\,x+2\,b\,x\,\mathrm {atan}\left (c\,x\right )-b\,x\,1{}\mathrm {i}\right )}{2}+\frac {c\,d\,\left (a\,x^2\,1{}\mathrm {i}+b\,x^2\,\mathrm {atan}\left (c\,x\right )\,1{}\mathrm {i}\right )}{2}+\frac {d\,\left (-b\,\ln \left (c^2\,x^2+1\right )+b\,\mathrm {atan}\left (c\,x\right )\,1{}\mathrm {i}\right )}{2\,c} \]

[In]

int((a + b*atan(c*x))*(d + c*d*x*1i),x)

[Out]

(d*(2*a*x - b*x*1i + 2*b*x*atan(c*x)))/2 + (c*d*(a*x^2*1i + b*x^2*atan(c*x)*1i))/2 + (d*(b*atan(c*x)*1i - b*lo
g(c^2*x^2 + 1)))/(2*c)